import 'package:fluro_decorate/fluro_decorate.dart';
import 'package:fluro_decorate/src/page_builder.dart';
import 'package:flutter/material.dart';

///
/// @ProjectName:    fluro_decorate
/// @Package:        
/// @ClassName:      router_register
/// @Description:    Router注册类
/// @Author:         WTT
/// @CreateDate:     2021/10/27 3:17 下午
///

abstract class IRouterRegister{
  /// 初始化路由
  void initRouters(){
    Map<String, PageBuilder> pageRoutes = onInit();
    pageRoutes.forEach((routePath, handler) {
      NavigatorUtil.router.define(routePath, handler: handler.getHandler());
    });
  }

  Map<String, PageBuilder> onInit();

}

abstract class RouterRegister extends IRouterRegister{
  @override
  Map<String, PageBuilder> onInit();
}